//
//  LSYReadModel.h
//  LSYReader
//
//  Created by Labanotation on 16/5/31.
//  Copyright © 2016年 okwei. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "LSYMarkModel.h"
#import "LSYNoteModel.h"
#import "LSYRecordModel.h"
#import "LSYChapterModel.h"
#import "LSYBook.h"
@interface LSYReadModel : NSObject<NSCoding>
@property (nonatomic,strong) NSString *resourcePath;
@property (nonatomic,strong) NSString *title;
@property (nonatomic,strong) NSString *content;
@property (nonatomic,assign) ReaderType type;
@property (nonatomic,strong) NSMutableArray <LSYMarkModel *>*marks;
@property (nonatomic,strong) NSMutableArray <LSYNoteModel *>*notes;
@property (nonatomic,strong) NSMutableArray <LSYChapterModel *>*chapters;
@property (nonatomic,strong) NSMutableDictionary *marksRecord;
@property (nonatomic,strong) LSYRecordModel *record;
@property (nonatomic,strong) LSYBook *netBook;

-(NSURL *)resourceUrl;
-(instancetype)initWithContent:(NSString *)content;
-(instancetype)initWithePub:(NSString *)ePubPath;
-(instancetype)initWithNetBook:(LSYBook *)netBook;
-(NSString *)percentStrig;
-(void)updateReadModel:(LSYReadModel *)model;
+(void)updateLocalModel:(LSYReadModel *)readModel url:(NSURL *)url;
+(id)getLocalModelWithPath:(NSString *)path;
@end
